package fhp.hlhj.giantfold.module

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.SelfOrderBean
import fhp.hlhj.giantfold.network.UrlApis
import fhp.hlhj.giantfold.utils.LogUtil

/**
 * author: FHP
 * data: on 2018\1\25 0025 16:46
 * E-Mail: 103945089@qq.com
 */
class SelfOrderModule {
    interface SelfOrderListener{
        fun showLoading()
        fun onLoadOrderListener(selfOrderBean: SelfOrderBean)
    }

    fun getselfOrder(params: HttpParams,listener: SelfOrderListener){
        UrlApis.getSelfOrder(params)
                .doOnSubscribe {
                    listener.showLoading()
                }
                .subscribe({
                    data->
                    listener.onLoadOrderListener(data)
                },{
                    erro->
                    LogUtil.log("拉取订单错误$erro")
                })
    }
}